home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / WB_33C.ARJ / NETWORK.TX$ < prev    next >
Text File  |  1992-05-20  |  10KB  |  475 lines

  1. NetAddCon
  2.  
  3. Connects network resources to imaginary local 
  4. disk drives or printer ports.
  5.  
  6. Syntax:
  7.  
  8. NetAddCon (net-path, password, local-name)
  9.  
  10.    Parameters:
  11.      (s) net-path    net resource or string returned by NetBrowse.
  12.      (s) password    password required to access resource, or "".
  13.      (s) local-name    local drive name or printer port.
  14.  
  15.    Returns:
  16.      (i)    @TRUE if successful; @FALSE if unsuccessful.
  17.  
  18. You can use NetAddCon to connect a local drive 
  19. to a network directory, in which case "local-
  20. name" will be a drive name (eg, "Z:").  You can 
  21. also connect a local printer port to a network 
  22. print queue, in which case "local-name" will be 
  23. the name of the printer port (eg, "LPT1").
  24. Use the NetBrowse function to obtain a value 
  25. for "net-path".
  26.  
  27. If no password is required, use a null string 
  28. ("") for the "password" parameter.
  29.  
  30. Example:
  31.  
  32.   availdrive = DiskScan(0)
  33.   drvlen = StrLen(availdrive)
  34.   If drvlen == 0 Then Goto nomore
  35.   availdrive = StrSub(availdrive, drvlen - 2, 2)
  36.   netpath = NetBrowse(0)
  37.   pwd = AskPassword("Enter password for",netpath)
  38.   NetAddCon(netpath, pwd, availdrive)
  39.   Exit
  40.   :nomore
  41.   Message("Connect Drive to Net", "No drives avail for assignment")
  42.  
  43. See Also:
  44.   NetAttach, NetBrowse, NetCancelCon, NetGetCon, NetMapRoot
  45.  
  46.  
  47. ***
  48. NetAttach
  49.  
  50. Attaches to a network file server.
  51.  
  52. Syntax:
  53.  
  54. NetAttach (server-name)
  55.  
  56. Parameters:
  57.      (s) server-name    name of the network file server.
  58.  
  59. Returns:
  60.      (i)    @TRUE if successful; @FALSE if unsuccessful.
  61.  
  62. This function may not work with all networks.
  63.  
  64. Example:
  65.    NetAttach("userapps")
  66.  
  67. See Also:
  68. NetAddCon, NetDetach, NetLogin
  69.  
  70. ***
  71. NetBrowse
  72.  
  73. Displays a network dialog box allowing the user 
  74. to select a network resource.
  75.  
  76. Syntax:
  77.     NetBrowse (request#)
  78. Parameters:
  79.    (i) request#    see below.
  80. Returns:
  81.    (s)    see below.
  82.  
  83. Specifying a request# of 0 allows selection of 
  84. a network directory, and specifying a request# 
  85. of 1 allows selection of a network print queue.  
  86. This function returns a string that can be used 
  87. by NetAddCon to add a connection.
  88.  
  89. Example:
  90.   availdrive = DiskScan(0)
  91.   drvlen = StrLen(availdrive)
  92.   If drvlen == 0 Then Goto nomore
  93.   availdrive = StrSub(availdrive, drvlen - 2, 2)
  94.   netpath = NetBrowse(0)
  95.   pswd = AskPassword("Enter password for",netpath)
  96.   NetAddCon(netpath, pswd, availdrive)
  97.   Exit
  98.   :nomore
  99.   Message("Connect Drive to Net", "No drives avail for assignment")
  100.  
  101. See Also:
  102. NetAddCon, NetMapRoot
  103.  
  104.  
  105.  
  106.  
  107. ***
  108. NetCancelCon
  109.  
  110. Breaks a network connection.
  111.  
  112. Syntax:
  113.   NetCancelCon (name, force)
  114. Parameters:
  115.   (s) name    network resource name or local name.
  116.   (i) force    force flag (see below).
  117. Returns:
  118.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  119.  
  120. If force is set to 0, NetCancelCon will not 
  121. break the connection if any files on that 
  122. connection are still open.  If force is set to 
  123. 1, the connection will be broken regardless.
  124.  
  125. Example:
  126.  
  127.   availdrive = DiskScan(4)
  128.   n = ItemCount(availdrive, " ")
  129.   If n == 0 Then Exit
  130.   i = 1
  131.   dislist = ""
  132.   :loop
  133.   drv = ItemExtract(i, availdrive, " ")
  134.   dislist = StrCat(drv, Num2Char(9), 
  135.   NetGetCon(drv), "|")
  136.   i = i + 1
  137.   If i < n Then Goto loop
  138.   availdrive = ItemSelect("Disconnect", dislist, "|")
  139.   NetCancelCon(availdrive, 0)
  140.  
  141. See Also:
  142.  
  143. NetAddCon, NetDetach, NetGetCon
  144.  
  145.  
  146.  
  147. ***
  148. NetDetach
  149.  
  150. Detaches from a network file server.
  151.  
  152. Syntax:
  153.   NetDetach (server-name)
  154.  
  155. Parameters:
  156.   (s) server-name    name of the network file server.
  157. Returns:
  158.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  159.  
  160. This function may not work with all networks.
  161.  
  162. Example:
  163.   NetDetach("userapps")
  164.  
  165. See Also:
  166. NetAttach, NetCancelCon
  167.  
  168.  
  169.  
  170. ***
  171. NetDialog
  172.   Brings up the network driver's dialog box.
  173.  
  174. Syntax:
  175.   NetDialog ( )
  176. Parameters:
  177.   (none)
  178. Returns:
  179.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  180.  
  181. A network driver's dialog box displays 
  182. copyright information, and may allow access to 
  183. the network, depending on the particular 
  184. network driver.  The WIL program will wait 
  185. until the network dialog terminates before 
  186. continuing.
  187.  
  188. Example:
  189.   NetDialog()
  190.  
  191.  
  192. ***
  193. NetGetCaps
  194.   Returns information on network capabilities.
  195.  
  196. Syntax:
  197.   NetGetCaps (request#)
  198. Parameters:
  199.   (i) request#    see below.
  200. Returns:
  201.   (i)    see below.
  202.  
  203. NetGetCaps returns 0 if no network is installed 
  204. (it is the only network function you can use 
  205. without having a network installed and not get 
  206. an error).
  207. Req#    Return value
  208. 1    Network driver specification number
  209. 2    Type of network installed:
  210.     0    None
  211.     256    MS Network
  212.     512    Lan Manager
  213.     768    Novell NetWare
  214.     1024    Banyan Vines
  215.     1280    10 Net
  216.     (other)    Other network
  217. 3    Network driver version number
  218. 4    Returns 1 if any network is installed
  219. 6    Bitmask indicating whether the network 
  220.         driver supports the following 
  221.     connect functions:
  222.     1    AddConnection
  223.     2    CancelConnection
  224.     4    GetConnection
  225.     8    AutoConnect via DOS
  226.     16    BrowseDialog
  227. 7    Bitmask indicating whether the network 
  228.         driver supports the following 
  229.     print functions:
  230.     2    Open Print Job
  231.     4    Close Print Job
  232.     16    Hold Print Job
  233.     32    Release Print Job
  234.     64    Cancel Print Job
  235.     128    Set number of copies
  236.     256    Watch Print Queue
  237.     512    Unwatch Print Queue
  238.     1024    Lock Queue Data
  239.     2048    Unlock Queue Data
  240.     4096    Driver will send QueueChanged 
  241.                  messages to Print Manager
  242.     8192    Abort Print Job
  243.  
  244. Example:
  245.   caps = NetGetCaps(6)
  246.   If caps & 16 Then Message("", "Your network supports BrowseDialog")
  247. See Also:
  248. NetGetUser, WinConfig, WinMetrics, WinParmGet
  249.  
  250.  
  251. ***
  252. NetGetCon
  253.   Returns the name of a connected network resource.
  254.  
  255. Syntax:
  256.   NetGetCon (local-name)
  257. Parameters:
  258.   (s) local-name    local drive name or printer port.
  259. Returns:
  260.   (s)    name of network resource.
  261.  
  262. NetGetCon returns the name of the network 
  263. resource currently connected to "local-name".
  264.  
  265. Example:
  266.   local = AskLine("NetGetCon", "Enter local drive name", "")
  267.   If local == "" Then Exit
  268.   resource = NetGetCon(local)
  269.   Message("NetGetCon", "%local% is connected to %resource%")
  270.  
  271. See Also:
  272. NetAddCon, NetCancelCon
  273.  
  274.  
  275.  
  276.  
  277. ***
  278. NetGetUser
  279.   Returns the name of the user currently logged 
  280. into the network.
  281.  
  282. Syntax:
  283.   NetGetUser ( )
  284. Parameters:
  285.   (none)
  286. Returns:
  287.   (s)    name of current user.
  288.  
  289. Example:
  290.   IniWritePvt("Current Users", "Excel", 
  291.   NetGetUser(), "usagelog.ini")
  292.   Run("excel.exe", "")
  293.  
  294. See Also:
  295. NetGetCaps
  296.  
  297.  
  298.  
  299. ***
  300. NetLogin
  301.   Performs a network login.
  302. Syntax:
  303.   NetLogin (server-name, user-name, password)
  304. Parameters:
  305.   (s) server-name    name of the network file server.
  306.   (s) user-name    name of the current user.
  307.   (s) password    password required to access server, or "".
  308. Returns:
  309.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  310.  
  311. This function may not work with all networks. 
  312.  
  313. Example:
  314. pwd = AskPassword("Hello", "Enter password for network access")
  315. NetLogin("userapps", "admin1", pwd)
  316.  
  317. See Also:
  318. NetAttach, NetLogout
  319.  
  320.  
  321.  
  322. ***
  323. NetLogout
  324.   Performs a network logout.
  325. Syntax:
  326.   NetLogout (server-name)
  327. Parameters:
  328.   (s) server-name    name of the network file server.
  329. Returns:
  330.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  331.  
  332. This function may not work with all networks.
  333.  
  334. Example:
  335.   NetLogout("userapps")
  336.  
  337. See Also:
  338. NetLogin
  339.  
  340.  
  341.  
  342. ***
  343. NetMapRoot
  344.   Maps a local drive to a network resource.
  345. Syntax:
  346.   NetMapRoot (local-name, net-path)
  347. Parameters:
  348.   (s) local-name    local drive name.
  349.   (s) net-path    net resource or string returned by NetBrowse.
  350. Returns:
  351.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  352.  
  353. This function maps a local drive letter as the 
  354. fake root to a network resource.  This is 
  355. supported by Novell NetWare, but may not work 
  356. with any other networks.
  357.  
  358. Example:
  359.   availdrive = DiskScan(0)
  360.   drvlen = StrLen(availdrive)
  361.   If drvlen == 0 Then Goto nomore
  362.   availdrive = StrSub(availdrive, drvlen - 2, 2)
  363.   netpath = NetBrowse(0)
  364.   NetMapRoot(availdrive, netpath)
  365.   Exit
  366.   :nomore
  367.   Message("Connect Drive to Net", "No drives avail for assignment")
  368.  
  369. See Also:
  370. NetAddCon, NetBrowse, NetCancelCon
  371.  
  372.  
  373.  
  374.  
  375. ***
  376. NetMemberGet
  377.    Determines whether the current user is a member 
  378.    of a specific group.
  379.  
  380. Syntax:
  381.    NetMemberGet (server-name, group-name)
  382. Parameters:
  383.   (s) server-name    name of the network file server.
  384.   (s) group-name    name of the group.
  385. Returns:
  386.   (i)    @TRUE if successful; @FALSE if unsuccessful.
  387.  
  388. This function may not work with all networks.
  389.  
  390. Example:
  391.    member = NetMemberGet("userapps", "sales")
  392.    If member == @YES Then Run("notepad.exe", "dailyrpt.txt")
  393.  
  394. See Also:
  395. NetMemberSet
  396.  
  397.  
  398.  
  399.  
  400. ***
  401. NetMemberSet
  402.   Sets the current user as a member of a group.
  403.  
  404. Syntax:
  405.    NetMemberSet (server-name, group-name)
  406.  
  407. Parameters:
  408.    (s) server-name    name of the network file server.
  409.    (s) group-name    name of the group.
  410. Returns:
  411.    (i)    @TRUE if successful; @FALSE if unsuccessful.
  412.  
  413. This function may not work with all networks.  
  414.  
  415. Example:
  416.   NetMemberSet("userapps", "sales")
  417.  
  418. See Also:
  419. NetMemberGet
  420.  
  421.  
  422.  
  423.  
  424. ***
  425. NetMsgAll
  426.    Broadcasts a message to all users on the network.
  427.  
  428. Syntax:
  429.    NetMsgAll (server-name, message)
  430. Parameters:
  431.    (s) server-name    name of the network file server.
  432.    (s) message    message to be broadcast.
  433. Returns:
  434.    (i)    @TRUE if successful; @FALSE if unsuccessful.
  435.  
  436. This function may not work with all networks.
  437.  
  438. Example:
  439.    NetMsgAll("userapps", "System going down in 5 minutes.")
  440.  
  441. See Also:
  442. NetMsgSend
  443.  
  444. ***
  445. NetMsgSend
  446.    Sends a message to a specific user on the network.
  447.  
  448. Syntax:
  449.    NetMsgSend (server-name, user-name, message)
  450.  
  451. Parameters:
  452.    (s) server-name    name of the network file server.
  453.    (s) user-name    name of the user to whom the message should be sent.
  454.    (s) message      message to be sent.
  455. Returns:
  456.    (i)    @TRUE if successful; @FALSE if unsuccessful.
  457.  
  458. This function may not work with all networks.
  459.  
  460. Example:
  461.    NetMsgSend("userapps", "compmgr", "Are those reports ready yet?")
  462.  
  463. See Also:
  464. NetMsgAll
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.